#ifndef WORKER_H
#define WORKER_H

#include <QThread>
#include <QMutex>

class Worker : public QThread
{
    Q_OBJECT
public:
    void run() override;

    void clearData();

    void appendData(const QByteArray &array);

    void setStart();

    void setStop();
signals:
    void resultReady(const QString &s, double value);
private:
    //解析数据
    QString parseOneMessage();

    //转int
    int HexToInt(const QStringList& textList);
private:
    QByteArray m_pBufferArray;
    bool m_bisstart{false};
    QMutex mutex;
};

#endif // WORKER_H
